package com.epam.chenjo.ms.salary.web;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.epam.chenjo.ms.salary.model.SalaryDetails;
import com.epam.chenjo.ms.salary.service.SalaryService;

@RestController
public class SalaryController {
	@Autowired
	private SalaryService salaryService;

	@RequestMapping(value = "/salary/{empId}", method = RequestMethod.GET)
	public List<SalaryDetails> salaryDetails(@PathVariable String empId) {
		List<SalaryDetails> list = salaryService.getSalaries(empId);
		return list;
	}
}
